<?php
	$phyDetails = mysql_query("select * from physical_details as p, height as ht where ht.height_id = p.height_id  and user_id=".$_SESSION['user_id']);
	$getPhyDetails = mysql_fetch_array($phyDetails);
	$bd = $getPhyDetails['body_type_id'];
	$ec = $getPhyDetails['eye_color_id'];
	$hc = $getPhyDetails['hair_color_id'];
	$sc = $getPhyDetails['skin_color_id'];
	$ad = $getPhyDetails['Additional_info'];
?>
<script type="text/javascript" src="includes/tinymce/jscripts/tiny_mce/tiny_mce.js"></script>
<script type="text/javascript" src="js/tiny.js"></script>


<table>
<form action="phyDeatails_Process.php" method="post">
	<tr>
		<td colspan="2">Enter your physical details.</td>
	</tr>
	<tr>
		<td>How tall are you (height) :</td>
		<td>
			<input type="hidden" value="<?php echo $getPhyDetails['user_id'];?>" name="user_id" id="user_id">
			<select name="height" id="height">
				<option><?php echo $getPhyDetails['height'];?></option>
				<?php
						$selectHeight = mysql_query("select * from height");

						while($getHeight = mysql_fetch_array($selectHeight))
						{
					?>

						<option><?php echo $getHeight['height'];?></option>
					<?php
						}
					?>
			</select>			
		</td>
	</tr>
	<tr>
		<td>Your body type :</td>
		<?php
			$bodyType=mysql_query("select * from body_type order by body_type_id");
			while($getBodyType=mysql_fetch_array($bodyType))
			{
				if($bd == $getBodyType['body_type_id'])
				{
		?><td>
				<input type="radio" name="bodyType" id="<?php echo $getBodyType['body_type'];?>" value="<?php echo $getBodyType['body_type_id'];?>" checked="checked"><?php echo $getBodyType['body_type'];?></td>
		<?php
				}
				else
				{
		?>
				<td>
				<input type="radio" name="bodyType" id="<?php echo $getBodyType['body_type'];?>" value="<?php echo $getBodyType['body_type_id'];?>"><?php echo $getBodyType['body_type'];?></td>
		<?php
				}
			}
		?>
	</tr>
	<tr>
		<td>Eye color :</td>
		<?php
			$eye=mysql_query("select * from eye_color order by eye_color_id");
			while($geteye=mysql_fetch_array($eye))
			{
				if($ec == $geteye['eye_color_id'])
				{
		?>
		<td>
			<input type="radio" name="eyeColor" id="<?php echo $geteye['eye_color'];?>" value="<?php echo $geteye['eye_color_id'];?>" checked="checked"><?php echo $geteye['eye_color'];?>
		</td>
		<?php
				}
				else
				{
		?>
		<td>
			<input type="radio" name="eyeColor" id="<?php echo $geteye['eye_color'];?>" value="<?php echo $geteye['eye_color_id'];?>"><?php echo $geteye['eye_color'];?>
		</td>
		<?php
				}
			}
		?>
	</tr>
	<tr>
		<td>Hair color :</td>
			<?php
				$hair=mysql_query("select * from hair_type order by hair_type_id");
				while($getHair=mysql_fetch_array($hair))
				{
					if($hc == $getHair['hair_type_id'])
					{
			?>
				<td>
					<input type="radio" name="hairColor" id="<?php echo $getHair['hair'];?>" value="<?php echo $getHair['hair_type_id'];?>" checked="checked"><?php echo $getHair['hair'];?>
				</td>
			<?php
					}
					else
					{
			?>
				<td>
					<input type="radio" name="hairColor" id="<?php echo $getHair['hair'];?>" value="<?php echo $getHair['hair_type_id'];?>"><?php echo $getHair['hair'];?>
				</td>
			<?php
					}
				}
			?>
	</tr>
	<tr>
		<td>Skin color :</td>
			<?php
				$skin=mysql_query("select * from skin_type order by skin_type_id");
				while($getSkin=mysql_fetch_array($skin))
				{
					if($sc == $getSkin['skin_type_id'])
					{
			?>
			<td>
				<input type="radio" name="skinColor" id="<?php echo $getSkin['skin_type'];?>" value="<?php echo $getSkin['skin_type_id'];?>" checked="checked"><?php echo $getSkin['skin_type'];?>
			</td>
			<?php
					}
					else
					{
			?>
			<td>
				<input type="radio" name="skinColor" id="<?php echo $getSkin['skin_type'];?>" value="<?php echo $getSkin['skin_type_id'];?>"><?php echo $getSkin['skin_type'];?>
			</td>	
			<?php
					}
				}
			?>
	</tr>
	<tr>
		<td>Additional information :</td>
		<td colspan="5"><textarea name="addInfo" id="addInfo"><?php echo $ad;?></textarea></td>
	</tr>
	<tr>	
		<td>&nbsp;</td>
		<td><input type="submit" name="perDetailsSub" id="perDetailsSub" class="saveButton" value="">
		<input type="reset" name="reset" id="reset" class="resetButton"></td>
	</tr>
</form>
</table>
